//
//  ZyaTitleLabCell.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2021/3/23.
//  Copyright © 2021 zwb. All rights reserved.
//

import UIKit
import Eureka

final class ZyaTitleLabCell: Cell<ZyaTitleLabData>, CellType {
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var dateLabel: UILabel!
    @IBOutlet weak var bg: UIView!
    required init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    override func setup() {
        super.setup()
        // we do not want our cell to be selected in this case. If you use such a cell in a list then you might want to change this.
        selectionStyle = .none
        bg.backgroundColor = Theme.primaryLightColor
        titleLabel.textColor = .white
        // define fonts for our labels
        
        nameLabel.font = .systemFont(ofSize: 15)
        nameLabel.text = "fewfjiifweofjfoew\nfjwoefjiwefjowefjeffffffffffff\nfjwoefjwofjefjwfjwfj\nfjjjjjjjjjjjjjjj"
        nameLabel.numberOfLines = 0
        nameLabel.textAlignment = .left
        dateLabel.font = .systemFont(ofSize: 15)
        dateLabel.text = "fewfjiifwefffffffffffffffffffofjfoew\nfjwoef2222222222jiwefjowefjeffffffffffff\nfjwoefjwofjefjwfjwfj\nfjjjjjjjj33333333333jjjjjjj"
        dateLabel.numberOfLines = 0
        dateLabel.textAlignment = .right
      
        
      
    }
    override func update() {
        super.update()
        
        // we do not want to show the default UITableViewCell's textLabel
        textLabel?.text = nil
        
        // get the value from our row
        guard let user = row.value else { return }
        titleLabel.text = user.title
        nameLabel.text = user.left
        dateLabel.text = user.right
        
    }

}
struct ZyaTitleLabData: Equatable {
    var title: String
    var left: String
    var right: String
}
